package shoooter.entity.bonus;

import java.awt.Color;
import java.awt.Graphics2D;
import shoooter.GameState;
import shoooter.geometry.Vec2;

public class FastShootBonus extends Bonus {

    public FastShootBonus(GameState g) {
        super();
        this.type = FAST;
        elapsed_limit = 200;
        vPos = new Vec2(rand.nextDouble()*200+100, rand.nextDouble()*200+100);
        //vPos = new Vec2(200,200);
        this.g = g;
    }

    @Override
    void apply() {
        g.shoot_timer_limit = 1;
        g.POINTS = 50;
    }

    @Override
    void unapply() {
        if( (g.level % 5) != 0 ) {
            g.shoot_timer_limit = 3;
            g.POINTS = 20;
        }
    }

    @Override
    public void draw(Graphics2D g2d) {

        g2d.setColor(Color.CYAN);
        g2d.fillOval((int)this.getX()-w/2, (int)this.getY()-h/2, w, h);

        g2d.setColor(Color.BLACK);
        g2d.drawOval((int)this.getX()-w/2, (int)this.getY()-h/2, w, h);

    }
    
}
